<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Demo</title>
  <!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
    <link rel="stylesheet" href="/static/layui/css/layui.css">
    <script src="/static/layui/layui.js"></script>
    <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
</head>
<body>
<div id="modifyOu"></div>

{#<div id="ID-tree-demo-showLine"></div>#}
<br>
<hr>
<br>
<br>
{#<div id="ID-tree-demo-showLine2"></div>#}
<script>

layui.use(['tree', 'util','layer'], function(){
	  var tree = layui.tree
	  ,layer = layui.layer
	  ,util = layui.util

	  $.ajax({
			type: "post",
			url: "/new_data_ou",
			dataType: "json",
			success: function (result) {
				if(result.code == 0){
                    console.log('code=0')
                    console.log(result.data)
					 tree.render({
                         elem: '#modifyOu',
                         data: result.data,
                         {#onlyIconControl: true,#}
                         checkbox:false,
                         {#edit: ['add', 'update', 'del'],#}
                         {#click: function(obj){#}
						 {#     var data = obj.data;#}
                         {#     console.log(data)#}
						 {#     layer.msg('状态：'+ obj.state + '<br>节点数据：' + JSON.stringify(data));#}
						 {#   }#}

						  });


				}else{
					alert("请重试。");
				}
			}
		});

});



</script>
</body>
</html>